<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>登录-B-TEAM项目管理</title>
    <link href="layui/css/layui.css" rel="stylesheet" type="text/css">
    <link href="css/login.css" rel="stylesheet" type="text/css">

</head>
<body>
<div class="main">
    <div class="login-view">
        <div class="login-logo">
            <img height="100%" src="./images/logo.jpg">
        </div>

        <form class="layui-form" method="post">
            <div class="layui-form-item">
                <label class="layui-form-label">小组</label>
                <div class="layui-input-inline">
                    <input class="layui-input" name="username" placeholder="如：" required type="text" value="bteamSoft">
                </div>

            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">密码</label>
                <div class="layui-input-inline">
                    <input class="layui-input" name="password" required type="password" value="666">
                </div>

            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">记住我</label>
                <div class="layui-input-block">
                    <input checked lay-skin="switch" name="remember" type="checkbox">
                </div>
            </div>


            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-filter="login" lay-submit>登录</button>
                    <button class="layui-btn layui-btn-primary" type="reset">重置</button>
                </div>
            </div>
        </form>


    </div>
</div>

<script src="layui/layui.js" type="text/javascript"></script>

<script>

    layui.use(['form', 'jquery'], function () {
        var form = layui.form;
        var $ = layui.$;


        //监听提交
        form.on('submit(login)', function (data) {

            $.post('login', data.field, function (back) {
                if (back.status === 0) {
                    layer.msg(back.msg);

                } else if (back.status === 1) {
                    window.location.href = back.href;
                    return false;
                } else {
                    layer.msg("糟了，我也不知道为什么");
                }
            });
            return false;

        });
    });
</script>
</body>
</html>